//***************************************************************
//  pp85.java   Author:20172330
//
//    输入几个数字，求出他们的均值和方差。
//***************************************************************

import java.util.Scanner;
public class pp85
{
   public static void main(String[] args) 
   {
     double mean,sd;
     int num,a=0,b=0,c=0;
     String another = "y";

     int[] list = new int[50];
     Scanner number = new Scanner(System.in);

     while(another.equalsIgnoreCase("y") )
       {
	a++;
	System.out.println("继续输入则输y,否则输q");
        another= number.nextLine() ;
        another= number.nextLine() ;
        if(another.equalsIgnoreCase("y") )
        {
	System .out .println("请输入一组整数");
	num=number.nextInt() ;
	list[a]=num;
	 }
	}
	  for (int m=0;m<a;m++)
          {
		b +=list[m];
	  }
		mean = b/a ;

		for(int n=0;n<a;n++)
          {
		c +=Math.pow((double)list[c]-mean,2);
	  }
		sd = Math.sqrt(c);

		System .out .println("均值是：" + mean);
		System .out .println("标准方差是：" + sd);

	}
}


